package com.seventh.parkingrent.dao;

import com.seventh.parkingrent.domain.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author Lucas
 * @since 2021-08-25
 */
public interface UserMapper extends BaseMapper<User> {

    @Select("select distinct username from pr_user")
    List<String> selectUsername();

    @Select("select username from pr_user where user_id =#{userId}")
    String selectUsernameById(Integer userId);

    @Select("select user_id from pr_user where username = #{username}")
    Integer selectUserIdByUsername(String username);
}
